import { UserCollection } from "./UserCollection";
import { User } from "./User";

const user1 = new User('zhao')

const user2 = new User('qian')

const user3 = new User('sun')


const collection = new UserCollection()
collection.addFirend(user1)
collection.addFirend(user2)
collection.addFirend(user3)

const iterator = collection.createIterator()
console.log(iterator.hasMore())

console.log(iterator.getNext<User>().name)
console.log(iterator.getNext<User>().name)
console.log(iterator.getNext<User>().name)
console.log(iterator.getNext<User>())

console.log(iterator.hasMore())